import { BasicColumn } from '/src/components/Table';
import { FormSchema } from '/src/components/Table';
import { rules} from '/src/utils/helper/validator';
import { render } from '/src/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/src/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '点赞内容',
    align: 'center',
    dataIndex: 'contentName',
  },
  {
    title: '用户名',
    align: 'center',
    dataIndex: 'userId_dictText',
  },
  //：0-景区，1-反馈
  {
    title: '点赞类型',
    align: 'center',
    dataIndex: 'contentType_dictText',
    // customRender: ({ text }) => {
    //   return render.renderDict(text, 'like_content_ype');
    // },
  },
  // {
  //  title: '点赞类型对应id',
  //  align: 'center',
  //  dataIndex: 'contentId'
  // },
  {
    title: '点赞时间',
    align: 'center',
    dataIndex: 'likeTime',
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '点赞类型',
    field: 'contentType',
    component: 'JSelectMultiple',
    componentProps: {
      dictCode: 'like_content_ype',
    },
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户id',
    field: 'userId',
    component: 'Input',
  },
  //：0-景区，1-反馈
  {
    label: '点赞类型',
    field: 'contentType',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'like_content_ype',
    },
  },
  {
    label: '点赞类型对应id',
    field: 'contentId',
    component: 'Input',
  },
  {
    label: '点赞时间',
    field: 'likeTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  userId: { title: '用户id', order: 0, view: 'text', type: 'string' },
  contentType: { title: '点赞类型', order: 1, view: 'list', type: 'string', dictCode: '' },
  contentId: { title: '点赞类型对应id', order: 2, view: 'text', type: 'string' },
  likeTime: { title: '点赞时间', order: 3, view: 'datetime', type: 'string' },
};

/**
 * 流程表单调用这个方法获取formSchema
 * @param param
 */
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
